
<?php
foreach($registro_menu as $menu){
?>

<script type="text/javascript">
$(document).ready(function(){
$("#menu_<?php echo $menu->cate_id; ?>").click(function(){
$("#cate_aberto_<?php echo $menu->cate_id; ?>").fadeIn("fast");
$("#cate_aberto_<?php echo $menu->cate_id; ?>").show();
});
});

$(document).ready(function() {
$("#menu_<?php echo $menu->cate_id; ?>").click(function() {
    
   
    <?php
    foreach($registro_menu as $menu2){
        
        if($menu2 <> $menu){
    ?>

        $("#cate_aberto_<?php echo $menu2->cate_id; ?>").fadeIn("fast");
        $("#cate_aberto_<?php echo $menu2->cate_id; ?>").hide();

    <?php
        }
    }
    ?>

});
});

</script>



<script type="text/javascript">
$(document).ready(function() {
$("#click_fora").click(function() {
    <?php
    foreach($registro_menu as $menu2){
    ?>
        $("#cate_aberto_<?php echo $menu2->cate_id; ?>").hide();
    <?php
    }
    ?>

});
});

</script>


<?php
}
?>



<?php // acaba no rodapé ----------------------------------------?>
<div class="corpo"> <?php // acaba no rodapé ----------------------------------------?>
<?php // acaba no rodapé ----------------------------------------?>   
    
    

<?php // menu topo  ------- ------- ---------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- --------?> 
  <div class="menu-top">
      <img style="float:left;" src="<?php echo base_url('assets/site/imagens/iconehome.png')?>" width="19" height="17" /><div class="home-menu"> <a href="<?php echo base_url(); ?>">Home</a></div>
        <div class="blog-menu"><a href="#">Nosso Blog</a></div>
    <div class="meni-top"><a href="#">Dúvidas Frequentes</a></div>
        <div class="meni-top"><a href="#">SAC</a></div>
        <div class="meni-top"><a href="#">Quem Somos</a></div>
    
    <!--menu-top--->
    </div> 
<?php // fim menu topo  ----- ----------- -------------- ------ ---- -------- -------- -------- -------- -------- -------- -------- -------- -------- --------?> 
    
 
    
    
<?php // barra de pesquisa, area do cliente, meu carrinho de compras  ----------- -------------- ---------- ----- -------- -------- -------- -------- -------- --------?> 
    <div class="logo"><a href="#"><img src="<?php echo base_url('assets/site/imagens/logo.png')?>" width="309" height="73"></a></div>
    <div class="busca"><input type="text" name="" value="O que voce procura?" /></div>
    <div class="espaco-cliente"><a href="#"><img src="<?php echo base_url('assets/site/imagens/espaco-cli.png')?>" width="107" height="105" /></a></div>
    <div class="meu-carrinho-bt"><a href="<?php echo base_url('meu_carrinho')?>"><img src="<?php echo base_url('assets/site/imagens/meu-carrinho.png')?>" width="95" height="97" /></a></div>
<?php // FIM barra de pesquisa, area do cliente, meu carrinho de compras  ---- ------------ ------------- ------- ---- -------- -------- -------- --------?>   
    
    
    
    
    
<div class="clear"></div>




<?php // menu categorias  ------- ------- --------- -------- ------ --- -------- -------- -------- -------- -------- -------- -------- -------- -------- --------?> 
  <div class="esq-menu"></div>
  
  <div id="pipi" class="menu">
      
      <?php
      $cates[0]=null;
      $cates[1]=null;
      $cates[2]=null;
      $cates[3]=null;
      $cates[4]=null;
      $cates[5]=null;
      $cates[6]=null;
      $cates[7]=null;
      $cates[8]=null;
      $cates[9]=null;
      ?>
        
    <?php
    foreach($registro_menu as $menu){
               
        for($i = 0 ; $i <= 10; $i++){

            if($menu->cate_posicao == $i){

               $cates[$i] = $menu->cate_id;

            }
        }

    ?>      
        <a id="menu_<?php echo $menu->cate_id ?>" href="#"><?php echo $menu->cate_nome?></a> &nbsp;&nbsp;
    <?php
    }
    ?>    
    <!--menu-->
    </div>
  <div class="dir-menu"></div>
 
  <?php // testes 
  
  //echo $posicao_home0;
  //echo print_r($cates);
  //print_r($registro_menu_cate).'<Br><BR><BR><BR>';
  //print_r($registro_menu).'<Br><BR><BR><BR>';
  
  ?>
  
  
<?php // ---- ---   MENU ABERTO ----- ------ ------ ----- ?>
  
 <!-- ITEM 1 CODIGO O ---->
<div id="cate_aberto_<?php echo $cates[0]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 

            <?php if($menu->cate_relacao_menu == $cates[0]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 1 CODIGO O ----> 
 
 <!-- ITEM 2 CODIGO 1 ---->
<div id="cate_aberto_<?php echo $cates[1]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[1]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 2 CODIGO 1 ----> 
 
<!-- ITEM 3 CODIGO 2 ---->
<div id="cate_aberto_<?php echo $cates[2]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[2]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 3 CODIGO 2 ---->   
  
<!-- ITEM 4 CODIGO 3 ---->
<div id="cate_aberto_<?php echo $cates[3]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[3]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 4 CODIGO 3 ---->   
  
<!-- ITEM 5 CODIGO 4 ---->
<div id="cate_aberto_<?php echo $cates[4]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[4]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 5 CODIGO 4 ---->  
 
<!-- ITEM 6 CODIGO 5 ---->
<div id="cate_aberto_<?php echo $cates[5]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[5]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 6 CODIGO 5 ---->  
 
<!-- ITEM 7 CODIGO 6 ---->
<div id="cate_aberto_<?php echo $cates[6]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[6]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM 7 CODIGO 6 ---->  
 
<!-- ITEM 8 CODIGO 7 ---->
<div id="cate_aberto_<?php echo $cates[7]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[7]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM  8 CODIGO 7 ---->  
 
 
<!-- ITEM 9 CODIGO 8 ---->
<div id="cate_aberto_<?php echo $cates[8]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[8]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM  9 CODIGO 8 ---->  
 
<!-- ITEM 10 CODIGO 9 ---->
<div id="cate_aberto_<?php echo $cates[9]?>"  class="menu-aberto">
    <div class="itens-menu">
        <?php foreach($registro_menu_cate as $menu){?> 
        
            <?php if($menu->cate_relacao_menu == $cates[9]){ ?>
                <div class="categoria-item"><?php echo $menu->cate_nome; ?></div>
                <!-- <div class="space-item"></div>----> 
            <?php }

        } ?>             
    </div>  
</div>
 <!-- fim ITEM  10 CODIGO 9 ---->  
 
 
 
 
 
<?php // ---- ---  FIM  MENU ABERTO ----- ------ ------ ----- ?>     
  
  
<!--  

        EXEMPLO DO MENU ABERTO SEM NENHUMA LATERAÇÃO 

  <div id="pipi_aberto_14"  class="menu-aberto">
  	<div class="itens-menu">
    	<div class="categoria-item">Cadeiras1</div>
        	<div class="space-item"></div>
        <div class="sub-cate-item">Branca1</div>
        	<div class="space-item"></div>
        <div class="sub-cate-item">Branca1</div>
        	<div class="space-item"></div>
        <div class="sub-cate-item">Branca1</div>
        	<div class="space-item"></div>
        <div class="sub-cate-item">Branca1</div>
        	<div class="space-item"></div>
        <div class="sub-cate-item">Branca1</div>
    
    </div>  

  </div>

-->
 
<?php // fiim menu categorias  ----- ----- ------ ---------- ------- ---- --- -------- -------- -------- -------- -------- -------- -------- -------- --------?> 

</div>

    
<div id='click_fora' style="width: 100%; height: 100%; z-index: 20000;">
    
<div class="corpo">